package grg.learn.compose.wanandroid.ui.theme

import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.*
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import com.google.accompanist.insets.ProvideWindowInsets

@Composable
fun GApp() {

    ProvideWindowInsets {

        GTheme {

            val appState = rememberGAppStatus()
            GScaffold(
                bottomBar = {

                },
                snackbarHost = {

                },
//                scaffoldState = ,
            ) {

                NavHost(
                    navController = appState.navController,
                    startDestination = GAppDestinations.HOME_ROUTE,
                    modifier = Modifier.padding(it)
                ){

                }

            }

        }

    }

}

private fun NavGraphBuilder.jetsnackNavGraph(
    onSnackSelected: (Long, NavBackStackEntry) -> Unit,
    upPress: () -> Unit
) {
//    navigation(
//        route = GAppDestinations.HOME_ROUTE,
//        startDestination = HomeSections.FEED.route
//    ) {
//        addHomeGraph(onSnackSelected)
//    }
//    composable(
//        "${GAppDestinations.SNACK_DETAIL_ROUTE}/{${GAppDestinations.SNACK_ID_KEY}}",
//        arguments = listOf(navArgument(GAppDestinations.SNACK_ID_KEY) { type = NavType.LongType })
//    ) { backStackEntry ->
//        val arguments = requireNotNull(backStackEntry.arguments)
//        val snackId = arguments.getLong(GAppDestinations.SNACK_ID_KEY)
//        SnackDetail(snackId, upPress)
//    }
}
